package homework.hucx.service;

import homework.hucx.dao.ArticleDao;
import homework.hucx.model.Article;

public class ArticleServiceImpl implements ArticleService {

    private ArticleDao articleDao;

    public void setArticleDao(ArticleDao articleDao) {
        this.articleDao = articleDao;
    }

    @Override
    public void save(Article article) {
        articleDao.save(article);
    }

    @Override
    public void saveAndUpdate(Article article,Integer id, String title) {
        articleDao.save(article);
//        int i = 1/0;
        articleDao.updateTitle(id,title);
    }
}
